1. Field of the Invention
This invention relates to the field of microprocessors and, more particularly, to the sharing of one or more registers between execution units of different types.
2. Description of the Related Art
Microprocessors are often configured to operate upon a variety of data types in order to provide computational solutions to a wide range of problems. For example, integer and floating point data types are common. The integer data type may be used in the case where the values to be operated upon are of approximately the same magnitude (as well as any intermediate results calculated in order to produce the results of interest). On the other hand, if the magnitudes of the values to be operated upon (or the intermediate results) are expected to vary widely, then the floating point data type may be more appropriate.
The data type used by each instruction within the instruction set is typically predefined as part of the instruction definition. For example, integer instructions are instructions which are defined to operate upon the integer data type. Similarly, floating point instructions are defined to operate upon the floating point data type. Generally, an instruction is the most basic operation which the programmer can specify in order to direct the microprocessor to perform a desired function. By arranging instructions in a particular order, the programmer may accomplish a specific objective. Instructions may be grouped with other instructions to form different instruction types according to the data type upon which they are defined to operate. Typically, an instruction is defined to receive one or more operands upon which to perform an operation (the "source operands") and is defined to store the result (the "destination operand").
As advances in semiconductor fabrication processes have been developed, it has become possible to increase the number of transistors which can be included upon a single chip and increase the operating frequencies of the chips. Accordingly, microprocessors have been able to increase performance through increased operating frequencies (i.e. shorter clock cycles) as well as through advanced microarchitectures made possible by the increase in available transistors.
One way to take advantage of the increase in available transistors is to add new data types to the microprocessor. The new data types may be specifically designed with a particular task in mind. The data type, and the instructions defined to operate upon the data type, may be optimized for the particular task. For example, the x86 instruction set has recently been expanded in this fashion. While previous microprocessors which implement the x86 instruction set (e.g. the 80486 from Intel Corporation and the 5.sub.K 86 from Advanced Micro Devices, Inc.) generally execute instructions specifying the floating point and integer data types, the most recent microprocessors implementations also execute instructions specifying the MMX data type. The MMX data type is a 64 bit operand treated as a set of packed integers. The packed integers may be eight 8 bit integers, four 16 bit integers, or two 32 bit integers.
The MMX data type and instructions which use the data type are optimized for video and audio data manipulations. Audio and/or video manipulation is referred to herein as "multimedia manipulation". These types of operations have become more important as computer systems have employed more advanced graphical user interfaces via the operating systems and application programs installed thereon. Additionally, the audio capabilities of computer systems have been enhanced. More particularly, the MMX data type allows for the same operation to be performed upon each of the integer values within the packed integer. Fewer instructions may be employed to perform the desired manipulations then would have otherwise been required, since one instruction may operate upon multiple values. For many video and/or audio computing tasks, the same operation is applied to a large number of data elements arranged for display or playback, and therefore instructions which perform the same operation upon multiple data elements may be advantageous.
In order to minimize the impact upon operating systems designed for the x86 architecture prior to the addition of the MMX data type and instructions, the registers defined to store the MMX operands are defined to be shared with the floating point registers. In other words, the MMX registers are architecturally defined to use the same storage locations as the floating point registers. In this manner, no new state is added to the microprocessor. Operating systems which do not recognize MMX instructions may still operate properly, as the data being used by the MMX instructions is stored in the same set of registers as the floating point data. Since these operating systems were already handling the floating point registers, the MMX registers are automatically handled.
The sharing of registers between data types may be advantageous for operating system compatibility, but creates additional hardware problems for microprocessors supporting the new data type and instructions. While it is generally illogical to store a value of one data type in a shared register and then use the shared register as a source operand for an instruction operating upon a different data type, it is desirable to provide defined behavior in such situations. In order to maintain compatibility with software written using the new data types, it is desirable to maintain this defined behavior when designing microprocessors which implement the architecture.
Another technique which may be desirable with certain data types is to store the data in an internal format. The internal format may differ from the architected format (defined by the architecture implemented by the microprocessor). More particularly, the internal format may allow for hardware optimizations to be made which may allow for more rapid execution of the instructions which use that data format. Higher frequency implementations of these types of execution units may thereby be achieved. Unfortunately, if the data type which uses the internal format is allocated to registers which are shared with another data type, the defined behavior when an instruction using one of the data types accesses a value which is actually of the other data type is destroyed. A method for allowing internal formats to be used for a data type which shares one or more registers with a different data type is therefore needed.